[Repo Assist] feat: enhance textDocument/implementation for .fsi ↔ .fs navigation#1494
Conversation
…fixes #1473) TextDocumentImplementation now supports bi-directional navigation between .fs implementation files and .fsi signature files via FCS-provided properties: - In a .fsi file: navigating to the .fs implementation uses symbol.ImplementationLocation (already available from FCS) - In a .fs file: navigating to the .fsi signature uses symbol.SignatureLocation (filtered to ensure it's actually a .fsi file) When neither location is available (e.g., no paired signature file, or the symbol is abstract/virtual), the existing dispatch-slot implementation lookup runs as a fallback, preserving existing behaviour. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
|
/repo-assist add tests for this feature |
|
/repo-assist rebase this PR on latest main to fix the conflicts, and add new tests to this PR |
|
/repo-assist resolve merge conflicts |
|
✅ Repo Assist completed successfully! |
…ementation Adds test cases for the feature introduced in PR #1494: - 'Go-to-implementation from .fsi navigates to .fs file': verifies that calling textDocument/implementation on a symbol in a .fsi file returns a location in the corresponding .fs implementation file. - 'Go-to-implementation from .fs navigates to .fsi signature file': verifies that calling textDocument/implementation on a symbol in a .fs file returns a location in the corresponding .fsi signature file. Test case project SignatureNavigation provides a minimal .fsi/.fs pair. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
|
🤖 This is an automated response from Repo Assist. I've added the tests requested by
The test project (
|
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #1473
Summary
This enhances
TextDocumentImplementation(textDocument/implementation) to support bi-directional navigation between.fsimplementation files and.fsisignature files, using FCS-provided symbol properties.Behaviour
.fsiImplementationLocation.fsimplementation.fsSignatureLocationpointing to.fsi.fsisignatureThe fallback preserves all existing
textDocument/implementationbehaviour for virtual/abstract member overrides.Implementation
FCS already exposes two properties on
FSharpSymbol:ImplementationLocation: the.fslocation for a symbol declared in a.fsifileSignatureLocation: the.fsilocation for a symbol defined in a.fsfileThe change (in
AdaptiveFSharpLspServer.fs,TextDocumentImplementationoverride):.fsi→ if so, usesImplementationLocationSignatureLocationpoints to a.fsifile → navigates thereCommands.symbolImplementationProjectpath when neither appliesTest Status
Build: ✅
dotnet build src/FsAutoComplete/FsAutoComplete.fsproj -c Release— 0 warnings, 0 errorsFormat: ✅
dotnet fantomasapplied; re-build passesFull test suite: deferred to CI (the change is in the LSP handler layer; no existing tests cover this code path directly)